<?php

require_once('_db/query.class.php');
require_once('main.class.php');

  class Users {
    /**
     * массив данных
     */
    private $_fetch = array();


    public static function isAuth() {
    /**
     * идентифицирован ли пользователь
     */
      if (isset($_SESSION['auth'])) {
         return true;
      } else {
         return false;
      }
    }

    public static function search($where, $what) {
    /**
     * поиск
     * @param string $where
     * @param string $what
     */
      Core::init();
      if ($where == "email"
      || $where == "mail") {
        self::$_fetch = db_query::getByEmail($what);
      }

      if ($where == "login"
      || $where == "name"
      || $where == "account"
      || $where == "user") {
        self::$_fetch = db_query::getByLogin($what);
      }

      return self::$_fetch;
    }

  }
  ###

?>

